﻿<Window x:Class="VoiceTestPlatform.RecordWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:l="clr-namespace:VoiceTestPlatform"
        Title="误操作测试" Height="480" Width="720">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <!--菜单项-->
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto" />
                
                <RowDefinition Height="auto" />
            </Grid.RowDefinitions>
            <StackPanel Orientation="Horizontal">
                <StackPanel.Resources>
                    <Style TargetType="Button">
                        <Setter Property="Width" Value="60" />
                        <Setter Property="Height" Value="60" />
                        <Setter Property="Margin" Value="5,5,0,5" />
                    </Style>
                </StackPanel.Resources>

                <Button Command="{Binding StartRecordCommand}" IsEnabled="{Binding IsStartEnable}">
                    <TextBlock Width="45" TextWrapping="WrapWithOverflow" Margin="0" >
                    开始录音(测试)
                    </TextBlock>
                </Button>
                <Button Command="{Binding StopRecordCommand}" IsEnabled="{Binding IsStopEnable}" >
                    <TextBlock Width="45" TextWrapping="WrapWithOverflow" Margin="0">
                    结束录音(测试)
                    </TextBlock>
                </Button>
                <!--距离 角度 噪音背景 时间差-->
                <!--<TextBlock Style="{StaticResource menuTxt}">距离:</TextBlock>
                <TextBox Style="{StaticResource menuTxtInput}" Text="{Binding ReDistanceText, Source={StaticResource  pm},UpdateSourceTrigger=PropertyChanged}"></TextBox>
                <TextBlock Style="{StaticResource menuTxt}">角度:</TextBlock>
                <TextBox Style="{StaticResource menuTxtInput}" Text="{Binding ReAngelText,Source={StaticResource  pm},UpdateSourceTrigger=PropertyChanged}"></TextBox>-->
                <TextBlock Style="{StaticResource menuTxt}">噪音背景:</TextBlock>
                <TextBox Style="{StaticResource menuTxtInput}" Text="{Binding ReNoiseText,Source={StaticResource  pm},UpdateSourceTrigger=PropertyChanged}"></TextBox>
               
            </StackPanel>
            <StackPanel VerticalAlignment="Center" Grid.Row="1">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Style="{StaticResource menuTxt}">开始时间:</TextBlock>
                    <TextBlock Style="{StaticResource menuTxt}" Text="{Binding StartRecordTime}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Style="{StaticResource menuTxt}">结束时间:</TextBlock>
                    <TextBlock Style="{StaticResource menuTxt}" Text="{Binding StopRecordTime}"/>
                </StackPanel>
            </StackPanel>
        </Grid>

        <ListView Grid.Row="1" ItemsSource="{x:Static l:ResultManager.RecordResults}" ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                      ScrollViewer.VerticalScrollBarVisibility="Auto">
            <ListView.View>
                <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="结果视图">
                    <GridViewColumn DisplayMemberBinding= "{Binding Path=TestDate}"   Header="时间" Width="100"/>

                    <GridViewColumn DisplayMemberBinding="{Binding Path=Recognition}"  Header="识别" Width="100" />
                   
                    <!--<GridViewColumn DisplayMemberBinding="{Binding Path=AudioCommand}"  Header="音频命令" Width="100"/>-->
                    <!--<GridViewColumn DisplayMemberBinding="{Binding Path=Audio}"  Header="相关音频" Width="100"/>-->
                    <GridViewColumn DisplayMemberBinding="{Binding Path=BackSound}"  Header="背景录音" Width="100"/>
                    <!--<GridViewColumn DisplayMemberBinding="{Binding Path=DistanceText}"  Header="距离" Width="100"/>
                    <GridViewColumn DisplayMemberBinding="{Binding Path=AngelText}"  Header="角度" Width="100"/>-->
                    <GridViewColumn DisplayMemberBinding="{Binding Path=NoiseText}"  Header="噪音背景" Width="100"/>
                </GridView>
            </ListView.View>
        </ListView>
        <StackPanel Orientation="Horizontal" Grid.Row="2">
            <Button Style="{StaticResource FooterButton}" Command="{Binding ResultToExcelCommand}">导出Excel</Button>
            <Button Style="{StaticResource FooterButton}" Width="100" Command="{Binding SavePortMsgCommand}">保存所有原消息</Button>
            <Button Style="{StaticResource FooterButton}" Width="100" Command="{Binding ClearResultCommand}">清除结果</Button>
            <Button Style="{StaticResource FooterButton}" Width="100" Visibility="Collapsed" Click="AddResutl_Click" >模拟增加结果</Button>
        </StackPanel>
    </Grid>
</Window>
